home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / QD3DCamera.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  14.1 KB  |  465 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DCamera.a
  3. ;
  4. ;    Contains:    Generic camera routines                                             
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3DCAMERA__') = 'UNDEFINED' THEN
  19. __QD3DCAMERA__ SET 1
  20.  
  21.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  22.     include 'QD3D.a'
  23.     ENDIF
  24.  
  25. ; ******************************************************************************
  26. ; **                                                                             **
  27. ; **                            Data Structure Definitions                         **
  28. ; **                                                                             **
  29. ; ****************************************************************************
  30.  
  31. ; *  The placement of the camera.
  32.  
  33. TQ3CameraPlacement        RECORD 0
  34. cameraLocation             ds        TQ3Point3D        ; offset: $0 (0)        ;   Location point of the camera     
  35. pointOfInterest             ds        TQ3Point3D        ; offset: $C (12)        ;   Point of interest                 
  36. upVector                 ds        TQ3Vector3D        ; offset: $18 (24)        ;   "up" vector                     
  37. sizeof                     EQU *                    ; size:   $24 (36)
  38.                         ENDR
  39. ; *  The range of the camera.
  40.  
  41. TQ3CameraRange            RECORD 0
  42. hither                     ds        Float32            ; offset: $0 (0)        ;   Hither plane, measured from "from" towards "to"    
  43. yon                         ds        Float32            ; offset: $4 (4)        ;   Yon  plane, measured from "from" towards "to"     
  44. sizeof                     EQU *                    ; size:   $8 (8)
  45.                         ENDR
  46. ; *  Viewport specification.  Origin is (-1, 1), and corresponds to the 
  47. ; *  upper left-hand corner; width and height maximum is (2.0, 2.0),
  48. ; *  corresponding to the lower left-hand corner of the window.  The
  49. ; *  TQ3Viewport specifies a part of the viewPlane that gets displayed 
  50. ; *    on the window that is to be drawn.
  51. ; *  Normally, it is set with an origin of (-1.0, 1.0), and a width and
  52. ; *  height of both 2.0, specifying that the entire window is to be
  53. ; *  drawn.  If, for example, an exposure event of the window exposed
  54. ; *  the right half of the window, you would set the origin to (0, 1),
  55. ; *  and the width and height to (1.0) and (2.0), respectively.
  56. ; *
  57.  
  58. TQ3CameraViewPort        RECORD 0
  59. origin                     ds        TQ3Point2D        ; offset: $0 (0)
  60. width                     ds        Float32            ; offset: $8 (8)
  61. height                     ds        Float32            ; offset: $C (12)
  62. sizeof                     EQU *                    ; size:   $10 (16)
  63.                         ENDR
  64. TQ3CameraData            RECORD 0
  65. placement                 ds        TQ3CameraPlacement ; offset: $0 (0)
  66. range                     ds        TQ3CameraRange ; offset: $24 (36)
  67. viewPort                 ds        TQ3CameraViewPort ; offset: $2C (44)
  68. sizeof                     EQU *                    ; size:   $3C (60)
  69.                         ENDR
  70. ; *  An orthographic camera.
  71. ; *
  72. ; *  The lens characteristics are set with the dimensions of a
  73. ; *  rectangular viewPort in the frame of the camera.
  74.  
  75. TQ3OrthographicCameraData RECORD 0
  76. cameraData                 ds        TQ3CameraData    ; offset: $0 (0)
  77. left                     ds        Float32            ; offset: $3C (60)
  78. top                         ds        Float32            ; offset: $40 (64)
  79. right                     ds        Float32            ; offset: $44 (68)
  80. bottom                     ds        Float32            ; offset: $48 (72)
  81. sizeof                     EQU *                    ; size:   $4C (76)
  82.                         ENDR
  83. ; *  A perspective camera specified in terms of an arbitrary view plane.
  84. ; *
  85. ; *  This is most useful when setting the camera to look at a particular
  86. ; *  object.  The viewPlane is set to distance from the camera to the object.
  87. ; *  The halfWidth is set to half the width of the cross section of the object,
  88. ; *  and the halfHeight equal to the halfWidth divided by the aspect ratio
  89. ; *  of the viewPort.
  90. ; * 
  91. ; *  This is the only perspective camera with specifications for off-axis
  92. ; *  viewing, which is desirable for scrolling.
  93.  
  94. TQ3ViewPlaneCameraData    RECORD 0
  95. cameraData                 ds        TQ3CameraData    ; offset: $0 (0)
  96. viewPlane                 ds        Float32            ; offset: $3C (60)
  97. halfWidthAtViewPlane     ds        Float32            ; offset: $40 (64)
  98. halfHeightAtViewPlane     ds        Float32            ; offset: $44 (68)
  99. centerXOnViewPlane         ds        Float32            ; offset: $48 (72)
  100. centerYOnViewPlane         ds        Float32            ; offset: $4C (76)
  101. sizeof                     EQU *                    ; size:   $50 (80)
  102.                         ENDR
  103. ; *    A view angle aspect camera is a perspective camera specified in 
  104. ; *    terms of the minimum view angle and the aspect ratio of X to Y.
  105. ; *
  106.  
  107. TQ3ViewAngleAspectCameraData RECORD 0
  108. cameraData                 ds        TQ3CameraData    ; offset: $0 (0)
  109. fov                         ds        Float32            ; offset: $3C (60)
  110. aspectRatioXToY             ds        Float32            ; offset: $40 (64)
  111. sizeof                     EQU *                    ; size:   $44 (68)
  112.                         ENDR
  113. ; ******************************************************************************
  114. ; **                                                                             **
  115. ; **                            Generic Camera routines                             **
  116. ; **                                                                             **
  117. ; ****************************************************************************
  118.  
  119.  
  120. ;
  121. ; extern TQ3ObjectType Q3Camera_GetType(TQ3CameraObject camera)
  122. ;
  123.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  124.         IMPORT_CFM_FUNCTION Q3Camera_GetType
  125.     ENDIF
  126.  
  127. ;
  128. ; extern TQ3Status Q3Camera_SetData(TQ3CameraObject camera, const TQ3CameraData *cameraData)
  129. ;
  130.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  131.         IMPORT_CFM_FUNCTION Q3Camera_SetData
  132.     ENDIF
  133.  
  134. ;
  135. ; extern TQ3Status Q3Camera_GetData(TQ3CameraObject camera, TQ3CameraData *cameraData)
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  138.         IMPORT_CFM_FUNCTION Q3Camera_GetData
  139.     ENDIF
  140.  
  141. ;
  142. ; extern TQ3Status Q3Camera_SetPlacement(TQ3CameraObject camera, const TQ3CameraPlacement *placement)
  143. ;
  144.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  145.         IMPORT_CFM_FUNCTION Q3Camera_SetPlacement
  146.     ENDIF
  147.  
  148. ;
  149. ; extern TQ3Status Q3Camera_GetPlacement(TQ3CameraObject camera, TQ3CameraPlacement *placement)
  150. ;
  151.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  152.         IMPORT_CFM_FUNCTION Q3Camera_GetPlacement
  153.     ENDIF
  154.  
  155. ;
  156. ; extern TQ3Status Q3Camera_SetRange(TQ3CameraObject camera, const TQ3CameraRange *range)
  157. ;
  158.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION Q3Camera_SetRange
  160.     ENDIF
  161.  
  162. ;
  163. ; extern TQ3Status Q3Camera_GetRange(TQ3CameraObject camera, TQ3CameraRange *range)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  166.         IMPORT_CFM_FUNCTION Q3Camera_GetRange
  167.     ENDIF
  168.  
  169. ;
  170. ; extern TQ3Status Q3Camera_SetViewPort(TQ3CameraObject camera, const TQ3CameraViewPort *viewPort)
  171. ;
  172.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION Q3Camera_SetViewPort
  174.     ENDIF
  175.  
  176. ;
  177. ; extern TQ3Status Q3Camera_GetViewPort(TQ3CameraObject camera, TQ3CameraViewPort *viewPort)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  180.         IMPORT_CFM_FUNCTION Q3Camera_GetViewPort
  181.     ENDIF
  182.  
  183. ;
  184. ; extern TQ3Status Q3Camera_GetWorldToView(TQ3CameraObject camera, TQ3Matrix4x4 *worldToView)
  185. ;
  186.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  187.         IMPORT_CFM_FUNCTION Q3Camera_GetWorldToView
  188.     ENDIF
  189.  
  190. ;
  191. ; extern TQ3Status Q3Camera_GetWorldToFrustum(TQ3CameraObject camera, TQ3Matrix4x4 *worldToFrustum)
  192. ;
  193.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  194.         IMPORT_CFM_FUNCTION Q3Camera_GetWorldToFrustum
  195.     ENDIF
  196.  
  197. ;
  198. ; extern TQ3Status Q3Camera_GetViewToFrustum(TQ3CameraObject camera, TQ3Matrix4x4 *viewToFrustum)
  199. ;
  200.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION Q3Camera_GetViewToFrustum
  202.     ENDIF
  203.  
  204.  
  205. ; ******************************************************************************
  206. ; **                                                                             **
  207. ; **                            Specific Camera Routines                          **
  208. ; **                                                                             **
  209. ; ****************************************************************************
  210.  
  211. ; ******************************************************************************
  212. ; **                                                                             **
  213. ; **                            Orthographic Camera                                  **
  214. ; **                                                                             **
  215. ; ****************************************************************************
  216.  
  217. ;
  218. ; extern TQ3CameraObject Q3OrthographicCamera_New(const TQ3OrthographicCameraData *orthographicData)
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  221.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_New
  222.     ENDIF
  223.  
  224. ;
  225. ; extern TQ3Status Q3OrthographicCamera_GetData(TQ3CameraObject camera, TQ3OrthographicCameraData *cameraData)
  226. ;
  227.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetData
  229.     ENDIF
  230.  
  231. ;
  232. ; extern TQ3Status Q3OrthographicCamera_SetData(TQ3CameraObject camera, const TQ3OrthographicCameraData *cameraData)
  233. ;
  234.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  235.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetData
  236.     ENDIF
  237.  
  238. ;
  239. ; extern TQ3Status Q3OrthographicCamera_SetLeft(TQ3CameraObject camera, float left)
  240. ;
  241.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetLeft
  243.     ENDIF
  244.  
  245. ;
  246. ; extern TQ3Status Q3OrthographicCamera_GetLeft(TQ3CameraObject camera, float *left)
  247. ;
  248.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  249.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetLeft
  250.     ENDIF
  251.  
  252. ;
  253. ; extern TQ3Status Q3OrthographicCamera_SetTop(TQ3CameraObject camera, float top)
  254. ;
  255.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetTop
  257.     ENDIF
  258.  
  259. ;
  260. ; extern TQ3Status Q3OrthographicCamera_GetTop(TQ3CameraObject camera, float *top)
  261. ;
  262.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  263.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetTop
  264.     ENDIF
  265.  
  266. ;
  267. ; extern TQ3Status Q3OrthographicCamera_SetRight(TQ3CameraObject camera, float right)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetRight
  271.     ENDIF
  272.  
  273. ;
  274. ; extern TQ3Status Q3OrthographicCamera_GetRight(TQ3CameraObject camera, float *right)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetRight
  278.     ENDIF
  279.  
  280. ;
  281. ; extern TQ3Status Q3OrthographicCamera_SetBottom(TQ3CameraObject camera, float bottom)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetBottom
  285.     ENDIF
  286.  
  287. ;
  288. ; extern TQ3Status Q3OrthographicCamera_GetBottom(TQ3CameraObject camera, float *bottom)
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  291.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetBottom
  292.     ENDIF
  293.  
  294.  
  295. ; ******************************************************************************
  296. ; **                                                                             **
  297. ; **                            ViewPlane Camera                                  **
  298. ; **                                                                             **
  299. ; ****************************************************************************
  300.  
  301. ;
  302. ; extern TQ3CameraObject Q3ViewPlaneCamera_New(const TQ3ViewPlaneCameraData *cameraData)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  305.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_New
  306.     ENDIF
  307.  
  308. ;
  309. ; extern TQ3Status Q3ViewPlaneCamera_GetData(TQ3CameraObject camera, TQ3ViewPlaneCameraData *cameraData)
  310. ;
  311.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetData
  313.     ENDIF
  314.  
  315. ;
  316. ; extern TQ3Status Q3ViewPlaneCamera_SetData(TQ3CameraObject camera, const TQ3ViewPlaneCameraData *cameraData)
  317. ;
  318.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  319.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetData
  320.     ENDIF
  321.  
  322. ;
  323. ; extern TQ3Status Q3ViewPlaneCamera_SetViewPlane(TQ3CameraObject camera, float viewPlane)
  324. ;
  325.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  326.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetViewPlane
  327.     ENDIF
  328.  
  329. ;
  330. ; extern TQ3Status Q3ViewPlaneCamera_GetViewPlane(TQ3CameraObject camera, float *viewPlane)
  331. ;
  332.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  333.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetViewPlane
  334.     ENDIF
  335.  
  336. ;
  337. ; extern TQ3Status Q3ViewPlaneCamera_SetHalfWidth(TQ3CameraObject camera, float halfWidthAtViewPlane)
  338. ;
  339.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  340.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetHalfWidth
  341.     ENDIF
  342.  
  343. ;
  344. ; extern TQ3Status Q3ViewPlaneCamera_GetHalfWidth(TQ3CameraObject camera, float *halfWidthAtViewPlane)
  345. ;
  346.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  347.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetHalfWidth
  348.     ENDIF
  349.  
  350. ;
  351. ; extern TQ3Status Q3ViewPlaneCamera_SetHalfHeight(TQ3CameraObject camera, float halfHeightAtViewPlane)
  352. ;
  353.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetHalfHeight
  355.     ENDIF
  356.  
  357. ;
  358. ; extern TQ3Status Q3ViewPlaneCamera_GetHalfHeight(TQ3CameraObject camera, float *halfHeightAtViewPlane)
  359. ;
  360.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  361.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetHalfHeight
  362.     ENDIF
  363.  
  364. ;
  365. ; extern TQ3Status Q3ViewPlaneCamera_SetCenterX(TQ3CameraObject camera, float centerXOnViewPlane)
  366. ;
  367.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetCenterX
  369.     ENDIF
  370.  
  371. ;
  372. ; extern TQ3Status Q3ViewPlaneCamera_GetCenterX(TQ3CameraObject camera, float *centerXOnViewPlane)
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  375.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetCenterX
  376.     ENDIF
  377.  
  378. ;
  379. ; extern TQ3Status Q3ViewPlaneCamera_SetCenterY(TQ3CameraObject camera, float centerYOnViewPlane)
  380. ;
  381.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  382.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetCenterY
  383.     ENDIF
  384.  
  385. ;
  386. ; extern TQ3Status Q3ViewPlaneCamera_GetCenterY(TQ3CameraObject camera, float *centerYOnViewPlane)
  387. ;
  388.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  389.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetCenterY
  390.     ENDIF
  391.  
  392.  
  393. ; ******************************************************************************
  394. ; **                                                                             **
  395. ; **                            View Angle Aspect Camera                          **
  396. ; **                                                                             **
  397. ; ****************************************************************************
  398.  
  399. ;
  400. ; extern TQ3CameraObject Q3ViewAngleAspectCamera_New(const TQ3ViewAngleAspectCameraData *cameraData)
  401. ;
  402.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  403.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_New
  404.     ENDIF
  405.  
  406. ;
  407. ; extern TQ3Status Q3ViewAngleAspectCamera_SetData(TQ3CameraObject camera, const TQ3ViewAngleAspectCameraData *cameraData)
  408. ;
  409.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  410.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_SetData
  411.     ENDIF
  412.  
  413. ;
  414. ; extern TQ3Status Q3ViewAngleAspectCamera_GetData(TQ3CameraObject camera, TQ3ViewAngleAspectCameraData *cameraData)
  415. ;
  416.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  417.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_GetData
  418.     ENDIF
  419.  
  420. ;
  421. ; extern TQ3Status Q3ViewAngleAspectCamera_SetFOV(TQ3CameraObject camera, float fov)
  422. ;
  423.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  424.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_SetFOV
  425.     ENDIF
  426.  
  427. ;
  428. ; extern TQ3Status Q3ViewAngleAspectCamera_GetFOV(TQ3CameraObject camera, float *fov)
  429. ;
  430.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  431.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_GetFOV
  432.     ENDIF
  433.  
  434. ;
  435. ; extern TQ3Status Q3ViewAngleAspectCamera_SetAspectRatio(TQ3CameraObject camera, float aspectRatioXToY)
  436. ;
  437.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  438.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_SetAspectRatio
  439.     ENDIF
  440.  
  441. ;
  442. ; extern TQ3Status Q3ViewAngleAspectCamera_GetAspectRatio(TQ3CameraObject camera, float *aspectRatioXToY)
  443. ;
  444.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  445.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_GetAspectRatio
  446.     ENDIF
  447.  
  448.  
  449.  
  450.  
  451.     ENDIF ; __QD3DCAMERA__ 
  452.  
  453.